#include "ast/Name.h"
#include "FunctionScope.h"

FunctionScope::FunctionScope(const FunctionDefPtr& node, Scope* parentScope):
    Scope(parentScope, parentScope->fileName())
{
    _name = node->name()->id();
    //TODO defvalues, types etc
    foreach(exprTypePtr name, node->args()->args()){
        QString aname = name.dynamicCast<Name>()->id();
        _argsNames.append(aname);
        _attributes[aname] = name.dynamicCast<Name>();
    }
}


QString FunctionScope::name()
{
    return _name;
}

QStringList FunctionScope::argNames()
{
    return _argsNames;
}
